# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.WorkloadManager.V1.Model.Evaluation do
  @moduledoc """
  LINT.IfChange Message describing Evaluation object

  ## Attributes

  *   `bigQueryDestination` (*type:* `GoogleApi.WorkloadManager.V1.Model.BigQueryDestination.t`, *default:* `nil`) - Optional. BigQuery destination
  *   `createTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. [Output only] Create time stamp
  *   `customRulesBucket` (*type:* `String.t`, *default:* `nil`) - The Cloud Storage bucket name for custom rules.
  *   `description` (*type:* `String.t`, *default:* `nil`) - Description of the Evaluation
  *   `evaluationType` (*type:* `String.t`, *default:* `nil`) - Evaluation type
  *   `labels` (*type:* `map()`, *default:* `nil`) - Labels as key value pairs
  *   `name` (*type:* `String.t`, *default:* `nil`) - name of resource names have the form 'projects/{project_id}/locations/{location_id}/evaluations/{evaluation_id}'
  *   `resourceFilter` (*type:* `GoogleApi.WorkloadManager.V1.Model.ResourceFilter.t`, *default:* `nil`) - annotations as key value pairs
  *   `resourceStatus` (*type:* `GoogleApi.WorkloadManager.V1.Model.ResourceStatus.t`, *default:* `nil`) - Output only. [Output only] The updated rule ids if exist.
  *   `ruleNames` (*type:* `list(String.t)`, *default:* `nil`) - the name of the rule
  *   `ruleVersions` (*type:* `list(String.t)`, *default:* `nil`) - Output only. [Output only] The updated rule ids if exist.
  *   `schedule` (*type:* `String.t`, *default:* `nil`) - crontab format schedule for scheduled evaluation, currently only support the following schedule: "0 */1 * * *", "0 */6 * * *", "0 */12 * * *", "0 0 */1 * *", "0 0 */7 * *",
  *   `updateTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. [Output only] Update time stamp
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :bigQueryDestination =>
            GoogleApi.WorkloadManager.V1.Model.BigQueryDestination.t() | nil,
          :createTime => DateTime.t() | nil,
          :customRulesBucket => String.t() | nil,
          :description => String.t() | nil,
          :evaluationType => String.t() | nil,
          :labels => map() | nil,
          :name => String.t() | nil,
          :resourceFilter => GoogleApi.WorkloadManager.V1.Model.ResourceFilter.t() | nil,
          :resourceStatus => GoogleApi.WorkloadManager.V1.Model.ResourceStatus.t() | nil,
          :ruleNames => list(String.t()) | nil,
          :ruleVersions => list(String.t()) | nil,
          :schedule => String.t() | nil,
          :updateTime => DateTime.t() | nil
        }

  field(:bigQueryDestination, as: GoogleApi.WorkloadManager.V1.Model.BigQueryDestination)
  field(:createTime, as: DateTime)
  field(:customRulesBucket)
  field(:description)
  field(:evaluationType)
  field(:labels, type: :map)
  field(:name)
  field(:resourceFilter, as: GoogleApi.WorkloadManager.V1.Model.ResourceFilter)
  field(:resourceStatus, as: GoogleApi.WorkloadManager.V1.Model.ResourceStatus)
  field(:ruleNames, type: :list)
  field(:ruleVersions, type: :list)
  field(:schedule)
  field(:updateTime, as: DateTime)
end

defimpl Poison.Decoder, for: GoogleApi.WorkloadManager.V1.Model.Evaluation do
  def decode(value, options) do
    GoogleApi.WorkloadManager.V1.Model.Evaluation.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.WorkloadManager.V1.Model.Evaluation do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
